#include <iostream>
#include <string>
#include <vector>
#include <array>
#include <cstring>


using namespace std;

void exer_1();
void exer_2();
void exer_3();
void exer_4();
void exer_5();
void exer_6();
void exer_7();
void exer_8();
void exer_9();
void exer_10();

int main(){
    exer_10();
    return 0;
}

void exer_1(){
    int i, j;
    cout << "Enter 1st num: ";
    cin >> i;
    cout << "Enter 2th num: ";
    cin >> j;

    for(int k = i; k < j;){
        i += ++k;
    }
    cout << i;
}

void exer_2(){
    const int ArSize =100;
    array<long double, ArSize> factorials;
    factorials[1] = factorials[0] = 1LL;

    for (int i = 2; i < ArSize; i++)
        factorials[i] = i * factorials[i-1];

    for (int i = 0; i < ArSize; i++)
        cout << i << "! = " << factorials[i] << endl;
}

void exer_3(){
    cout << "Enter num: ";
    int n;
    int k = 0;
    cin >> n;
    while(n != 0){
        k += n;
        cout << "Enter num: ";
        cin >> n;
    }
    cout << k;
}

void exer_4(){
    double duff = 100;
    double cleo = 100;
    double duff_proc = 10;
    double cleo_proc = 1.05;
    int i = 1;
    duff += duff_proc;
    cleo *= cleo_proc;

    while(duff > cleo){
        duff += duff_proc;
        cleo *= cleo_proc;
        //cout << duff << " " << cleo << endl;
        ++i;
    }
    cout << i;
}

void exer_5(){
    int const count = 12;
    string month[count] {"jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sem", "okt", "nob", "dec"};
    int volumn[count] {0};
    int sum(0);

    for(int i = 0; i < count; i++){
        cout << "In this month " << month[i] << " we sell, enter much books ";
        cin >> volumn[i];
        sum += volumn[i];
    }
    cout << sum;
}

void exer_6(){
    int const count = 12;
    int const yer_count = 3;
    string month[count] {"jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sem", "okt", "nob", "dec"};
    string yers[3] {"2010", "2011", "2012"};
    int volumn[count] {0};
    int sum[yer_count] {0};

    for(int j = 0; j < yer_count; j++){
        for(int i = 0; i < count; i++){
            cout << "In this month " << month[i] << " of " << yers[j] << " yers " << " we sell, enter much books ";
            cin >> volumn[i];
            sum[j] += volumn[i];
        }
    }

    int temp = 0;

    for(int g:sum){
        cout << yers[temp] << " = " << g << " total sell" << endl;
        temp++;
    }
}

void exer_7(){
    struct car{
        string name;
        int release;
    };

    int num (0);

    cout << "Wat num of cars: ";
    cin >> num;
    car *car_num = new car[num];

    for(int i = 0; i < num; i++){
        cout << "Automobile numero #" << i << endl;
        cout << "Automobile name: ";
        cin.ignore();
        getline(cin, car_num[i].name);
        cout << "Automobile release: ";
        cin >> car_num[i].release;
    }
    cout << "Here ur collections: " << endl;
    for(int i = 0; i < num; i++){
        cout << car_num[i].name << " " << car_num[i].release << endl;
    }
    delete [] car_num;
}

void exer_8(){
    char word[10];
    const char exit[] {"done"};

    int i(0);
    cin >> word;

    while(strcmp(word, exit)){
        ++i;
        cin >> word;
    }
    cout << "Count = " << i;
}

void exer_9(){
    string word;
    const string exit {"done"};

    int i(0);

    cin >> word;

    while(word != exit){
        i++;
        cin >> word;
    }
    cout << "Count = " << i;
}

void exer_10(){
    int i(0);
    cout << "Enter count of line: ";
    cin >> i;
    int ii = i + 1;

    while(i){
        for(int j = 0; j < i-1; j++)
            cout << '.';
        for(int g = ii; g > i; g--)
            cout << '*';

        cout << endl;

        i--;
    }
}
